<?php

class Application_Model_AventurineAcl extends Zend_Acl
{
    public function __construct() {
        //index
        $this->add(new Zend_Acl_Resource('index'));
        
        $this->add(new Zend_Acl_Resource('info'));
        $this->add(new Zend_Acl_Resource('messages'));
        
        $this->add(new Zend_Acl_Resource('operation'));
            $this->add(new Zend_Acl_Resource('genset'));
            $this->add(new Zend_Acl_Resource('hargasewa'));
            $this->add(new Zend_Acl_Resource('laporangenset'));
        
        //finance
        $this->add(new Zend_Acl_Resource('finance'));
        
            //supplier
            $this->add(new Zend_Acl_Resource('supplier'));
            
            //statussupplier
            $this->add(new Zend_Acl_Resource('statussupplier'));
        
        //marketing
        $this->add(new Zend_Acl_Resource('marketing'));
            $this->add(new Zend_Acl_Resource('konsumen'));
            $this->add(new Zend_Acl_Resource('project'));
            $this->add(new Zend_Acl_Resource('retail'));
        
        $this->add(new Zend_Acl_Resource('settings'));
        $this->add(new Zend_Acl_Resource('personal'));
        $this->add(new Zend_Acl_Resource('userdata'));
        
        //hrd
        $this->add(new Zend_Acl_Resource('hrd'));
            
            //pegawai
            $this->add(new Zend_Acl_Resource('pegawai'));
        
            //departemen
            $this->add(new Zend_Acl_Resource('departemen'));
            $this->add(new Zend_Acl_Resource('add'), 'departemen');
            $this->add(new Zend_Acl_Resource('edit'), 'departemen');
            $this->add(new Zend_Acl_Resource('delete'), 'departemen');
       //Procurement     
       $this->add(new Zend_Acl_Resource('proc'));
        $this->add(new Zend_Acl_Resource('reqa'));
        $this->add(new Zend_Acl_Resource('reqb'));
        $this->add(new Zend_Acl_Resource('po'));
            
            //posisi
            $this->add(new Zend_Acl_Resource('posisi'));
            
            $this->add(new Zend_Acl_Resource('statuspegawai'));
            
        //reports
        $this->add(new Zend_Acl_Resource('reports'));
            
            $this->add(new Zend_Acl_Resource('aktivitasgenset'));
        
        $this->add(new Zend_Acl_Resource('test'));
        $this->add(new Zend_Acl_Resource('async'));
        
        //auth
        $this->add(new Zend_Acl_Resource('auth'));
        $this->add(new Zend_Acl_Resource(('login'),'auth'));
        $this->add(new Zend_Acl_Resource(('logout'),'auth'));        
        
        //admin
        $this->add(new Zend_Acl_Resource('admin'));
        $this->add(new Zend_Acl_Resource('user'));
        $this->add(new Zend_Acl_Resource('help'));
        
        $this->addRole(new Zend_Acl_Role('5'));
        $this->addRole(new Zend_Acl_Role('2','5'));
        $this->addRole(new Zend_Acl_Role('1'),'2');
        
        //guest
        $this->allow('5', 'login');
        
        //staff
        $this->allow('2', array('index','reports','logout','info','help','aktivitasgenset','personal','userdata','messages'));
        
        //admin
        $this->allow('1', array('hrd','departemen','pegawai','finance','supplier','proc','marketing',
                                'operation','admin','settings','posisi','statuspegawai','statussupplier',
                                'genset','user', 'konsumen', 'project', 'retail','test','async','hargasewa', 
                                'laporangenset','reqa','reqb','po'));
    }

}

